package cn.edu.njust.alg;

public class Hanoi {
	
	public static void hanoi(int n, String src,String des,String temp) {
		if(n<1)
			return;
		if(n==1){
			System.out.println("move from "+src+" to "+des);
			return;
		}else{
			hanoi(n-1, src, temp, des);
			System.out.println("move from "+src+" to "+des);
			hanoi(n-1, temp, des, src);
		}
	}

	public static void main(String[] args) {
		hanoi(3, "a", "c", "b");

	}

}
